package jmine.tec.di.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation to express beans that should have his properties set by some external container.
 * 
 * @author takeshi
 */
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface InjectedBean {

    /**
     * If true, the loader will inject dependencies using the bean definition from the BeanFactory. In this case,
     * {@link #beanFactoryDefinitionName()} must not be empty and must resolve to a bean definition on the bean factory hierarchy
     */
    boolean useBeanFactoryDefinition() default false;

    /**
     * The name of the bean definition on the beanFactory. Will be ignored unless {@link #useBeanFactoryDefinition()} is true, in witch
     * case, the bean factory must have a bean definition with this name
     */
    String beanFactoryDefinitionName() default "";
}
